<div ng-init="init();" class="kmi-layout-content B0504-content">
    <div class="kmi-header-row">
        <div class="kmi-side-btn left" ng-click="back();">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="brand-title">
            <div class="custom" ng-if="companyName">
                <div class="title" ng-bind="companyName"></div>
                <img src="" alt="" class="brand">
                <div class="gap"></div>
            </div>
            <div class="digiwin">
                <img src="image/smes_v340/logo_ch.png" alt="">
                <img src="image/smes_v340/logo_en.png" alt="">
            </div>
        </div>
        <div class="header-title" ng-bind="'B0504.title' | translate"></div>
        <div class="header-logo"></div>
    </div>
    <div class="kmi-layout-main-content">
        <div class="kmi-layout-page">
            <div class="contentPanel">
                <div class="workInfoPanel">
                    <div class="workInfoPanel-left">
                        <!-- <div class="kmi-text-fields" >
                            <label class="label" ng-bind="'B0504.qc_form_no' | translate"></label>
                            <input ng-model="workItem.qc_form_no" readonly="readonly">
                            <div class="tip"><i class="material-icons">&#xE5CF;</i></div>
                        </div> -->
                        <div class="kmi-text-fields" >
                            <label class="label" ng-bind="'B0504.item_type' | translate"></label>
                            <input ng-model="workItem.item_type_display" readonly="readonly" ng-click="loadItemType();">
                            <div class="tip"><i class="material-icons">&#xE5CF;</i></div>
                        </div>
                        <div class="kmi-text-fields" >
                            <label class="label" ng-bind="'B0504.item_no' | translate"></label>
                            <input ng-model="workItem.item_no" readonly="readonly" ng-click="loadItemNo();">
                            <div class="tip"><i class="material-icons">&#xE5CF;</i></div>
                            <!-- <div class="tip search" ng-click="loadItemNo();"><img src="image/icons/search.png"></img> </div> -->
                        </div>
                        <div class="kmi-text-fields" >
                            <label class="label" ng-bind="'B0504.inspect_type' | translate"></label>
                            <input ng-model="workItem.inspect_type_display" readonly="readonly" ng-click="loadInspectType();">
                            <div class="tip"><i class="material-icons">&#xE5CF;</i></div>
                        </div>
                        <div class="kmi-text-fields" >
                            <label class="label" ng-bind="'B0504.plot_no' | translate"></label>
                            <input ng-model="workItem.plot_no">
                            <div class="tip search"><i class="material-icons" ng-click="loadPlotList();">search</i></div>
                        </div>
                        <div class="kmi-text-fields" >
                            <label class="label" ng-bind="'B0504.is_urgent' | translate"></label>
                            <button class="mdl-button mdl-js-button kmi-checkbox" ng-click="workItem.is_urgent = 'Y'">
                                <img ng-show="workItem.is_urgent != 'Y'" src="image/icons/check0.png"></img>
                                <img ng-show="workItem.is_urgent == 'Y'" src="image/icons/check1.png"></img>
                                {{'B0504.is_urgents.Y' | translate}}
                            </button>
                            <button class="mdl-button mdl-js-button kmi-checkbox" ng-click="workItem.is_urgent = 'N'">
                                <img ng-show="workItem.is_urgent != 'N'" src="image/icons/check0.png"></img>
                                <img ng-show="workItem.is_urgent == 'N'" src="image/icons/check1.png"></img>
                                {{'B0504.is_urgents.N' | translate}}
                            </button>
                        </div>
                        <div class="kmi-text-fields" >
                            <label class="label" ng-bind="'B0504.qty' | translate"></label>
                            <input style="flex:0 0 140px;margin-right: 4px;" readonly="readonly" ng-click="input_qty($event);" ng-value="workItem.qty"></input>
                            <label ng-bind="workItem.disposed_unit"></label>
                        </div>
                        <div class="kmi-text-fields">
                            <label class="label" ng-bind="'B0504.item_name' | translate"></label>
                            <label class="value" ng-bind="workItem.item_name" style="width: 60px;text-align: left;"></label>
                        </div>
                        <div class="kmi-text-fields">
                            <label class="label" ng-bind="'B0504.qc_category' | translate"></label>
                            <label class="value" ng-bind="workItem.qc_category" style="width: 60px;text-align: left;"></label>
                        </div>
                        <div class="kmi-text-fields">
                            <label class="label" ng-bind="'B0504.item_spec' | translate"></label>
                            <label class="value" ng-bind="workItem.item_spec" style="width: 60px;text-align: left;"></label>
                        </div>
                        <div class="kmi-text-fields">
                            <label class="label" ng-bind="'B0504.article_no' | translate"></label>
                            <label class="value" ng-bind="workItem.article_no" style="width: 60px;text-align: left;"></label>
                        </div>
                        <div class="kmi-text-fields">
                            <label class="label" ng-bind="'B0504.unit' | translate"></label>
                            <label class="value" ng-bind="workItem.unit" style="width: 60px;text-align: left;"></label>
                        </div>
                    </div>
                    <div class="workInfoPanel-right">
                        <div class="kmi-text-fields" >
                            <label class="label" ng-bind="'B0504.op_no' | translate"></label>
                            <input ng-model="workItem.op_no" readonly="readonly" ng-click="loadOpNo();">
                            <div class="tip"><i class="material-icons">&#xE5CF;</i></div>
                        </div>
                        <div class="kmi-text-fields" >
                            <label class="label" ng-bind="'B0504.plan_insp_date' | translate"></label>
                            <input style="flex:0 0 150px;" ng-value="workItem.plan_insp_date |date:'yyyy-MM-dd'" readonly ng-click="changeDate();"/>
                            <div class="tip"><i class="material-icons">&#xE5CF;</i></div>
                        </div>
                        <div class="kmi-text-fields fields-description">
                            <label class="label" ng-bind="'B0504.memo' | translate"></label>
                            <textarea ng-model="workItem.memo"></textarea>
                        </div>
                        <div class="content-column">
                            <div class="kmi-list">
                                <div class="kmi-list__header">
                                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0504.qc_item_detail.column1' | translate"></div>
                                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0504.qc_item_detail.column2' | translate"></div>
                                    <div class="kmi-list__column" style="flex:0 0 100px;" ng-bind="'B0504.qc_item_detail.column3' | translate"></div>
                                </div>
                                <div class="kmi-list__row-content">
                                    <div class="kmi-list__row" ng-repeat="item in qc_item_detail track by $index">
                                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.qc_item_no"></div>
                                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.qc_item_name"></div>
                                        <div class="kmi-list__column" style="flex:0 0 100px;" ng-bind="'B0504.qc_item_type_'+ item.qc_type | translate"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="kmi-button btn-expand kmi-button-confrim" ng-click="open_qcItem_editor();">
                                <label ng-bind="'B0504.qcItem_edit' | translate"></label>
                                <div class="kmi-can-click"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="kmi-layout-footer">
            <button class="mdl-button mdl-js-button mdl-button--fab mdl-shadow--custom mdl-button--custom1"
            ng-click="confirm();" ng-disabled="!workItem">
              <i class="material-icons">done</i>
            </button>
        </div>
    </div>
</div>
